import request from '@/utils/request'

// 查询签到记录列表
export function listSign(query) {
  return request({
    url: '/secondclass/sign/list',
    method: 'get',
    params: query
  })
}

// 查询签到记录详细
export function getSign(signId) {
  return request({
    url: '/secondclass/sign/' + signId,
    method: 'get'
  })
}

// 新增签到记录
export function addSign(data) {
  return request({
    url: '/secondclass/sign',
    method: 'post',
    data: data
  })
}

// 修改签到记录
export function updateSign(data) {
  return request({
    url: '/secondclass/sign',
    method: 'put',
    data: data
  })
}

// 删除签到记录
export function delSign(signId) {
  return request({
    url: '/secondclass/sign/' + signId,
    method: 'delete'
  })
}

// 根据活动ID查询签到记录
export function getSignsByActivity(activityId) {
  return request({
    url: '/secondclass/sign/activity/' + activityId,
    method: 'get'
  })
}

// 根据报名ID查询签到记录
export function getSignByEnrollment(enrollmentId) {
  return request({
    url: '/secondclass/sign/enrollment/' + enrollmentId,
    method: 'get'
  })
}